var y = Object.defineProperty;
var m = (e, t, o) =>
  t in e
    ? y(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o })
    : (e[t] = o);
var r = (e, t, o) => (m(e, typeof t != 'symbol' ? t + '' : t, o), o);
import { MAP as l, SCALAR as h, SEQ as f } from '../nodes/identity.js';
import { map as u } from './common/map.js';
import { seq as O } from './common/seq.js';
import { string as k } from './common/string.js';
import { getTags as i, coreKnownTags as j } from './tags.js';
const A = (e, t) => (e.key < t.key ? -1 : e.key > t.key ? 1 : 0);
class p {
  constructor({
    compat: t,
    customTags: o,
    merge: a,
    resolveKnownTags: c,
    schema: n,
    sortMapEntries: s,
    toStringDefaults: g,
  }) {
    r(this, 'compat');
    r(this, 'knownTags');
    r(this, 'merge');
    r(this, 'name');
    r(this, 'sortMapEntries');
    r(this, 'tags');
    r(this, 'toStringOptions');
    (this.compat = Array.isArray(t) ? i(t, 'compat') : t ? i(null, t) : null),
      (this.merge = !!a),
      (this.name = (typeof n == 'string' && n) || 'core'),
      (this.knownTags = c ? j : {}),
      (this.tags = i(o, this.name)),
      (this.toStringOptions = g ?? null),
      Object.defineProperty(this, l, { value: u }),
      Object.defineProperty(this, h, { value: k }),
      Object.defineProperty(this, f, { value: O }),
      (this.sortMapEntries = typeof s == 'function' ? s : s === !0 ? A : null);
  }
  clone() {
    const t = Object.create(
      p.prototype,
      Object.getOwnPropertyDescriptors(this),
    );
    return (t.tags = this.tags.slice()), t;
  }
}
export { p as Schema };
